<?php
@session_start();
?>
<?php
@session_start();
?>
<?php require_once('../Connections/elevate954.php'); ?>
<?php require_once("../webassist/form_validations/wavt_scripts_php.php"); ?>
<?php require_once("../webassist/form_validations/wavt_validatedform_php.php"); ?>
<?php require_once( "../webassist/security_assist/helper_php.php" ); ?>
<?php 
if (isset($_POST["LogIn_submit"]))  {
  $WAFV_Redirect = "".(htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES))  ."?invalid=true";
  $_SESSION['WAVT_loginmembers_Errors'] = "";
  if ($WAFV_Redirect == "")  {
    $WAFV_Redirect = $_SERVER["PHP_SELF"];
  }
  $WAFV_Errors = "";
  $WAFV_Errors .= WAValidateRQ((isset($_POST["Log_In_group_MEMBER_USERNAME"])?$_POST["Log_In_group_MEMBER_USERNAME"]:"") . "",true,1);
  $WAFV_Errors .= WAValidateEL((isset($_POST["Log_In_group_MEMBER_USERNAME"])?$_POST["Log_In_group_MEMBER_USERNAME"]:"") . "",6,100,true,2);
  $WAFV_Errors .= WAValidateRQ((isset($_POST["Log_In_group_MEMBER_PASSWORD"])?$_POST["Log_In_group_MEMBER_PASSWORD"]:"") . "",true,3);
  $WAFV_Errors .= WAValidateEL((isset($_POST["Log_In_group_MEMBER_PASSWORD"])?$_POST["Log_In_group_MEMBER_PASSWORD"]:"") . "",6,500,true,4);

  if ($WAFV_Errors != "")  {
    PostResult($WAFV_Redirect,$WAFV_Errors,"loginmembers");
  }
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(!isset($_POST["Log_In_group_Remember_my_information"])) && $_POST["LogIn_submit"] != "")) {
	setcookie("RememberMePWD", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(!isset($_POST["Log_In_group_Remember_my_information"])) && $_POST["LogIn_submit"] != "")) {
	setcookie("RememberMeUN", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(isset($_POST["Log_In_group_Remember_my_information"])) && $_POST["Log_In_group_Remember_my_information"] != "")) {
	setcookie("RememberMePWD", "".((isset($_POST["Log_In_group_MEMBER_PASSWORD"]))?$_POST["Log_In_group_MEMBER_PASSWORD"]:"")  ."", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(isset($_POST["Log_In_group_Remember_my_information"])) && $_POST["Log_In_group_Remember_my_information"] != "")) {
	setcookie("RememberMeUN", "".((isset($_POST["Log_In_group_MEMBER_USERNAME"]))?$_POST["Log_In_group_MEMBER_USERNAME"]:"")  ."", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(!isset($_POST["Log_In_group_Log_me_in_automatically"])) && $_POST["LogIn_submit"] != "")) {
	setcookie("AutoLoginPWD", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(!isset($_POST["Log_In_group_Log_me_in_automatically"])) && $_POST["LogIn_submit"] != "")) {
	setcookie("AutoLoginUN", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(isset($_POST["Log_In_group_Log_me_in_automatically"])) && $_POST["Log_In_group_Log_me_in_automatically"] != "")) {
	setcookie("AutoLoginPWD", "".((isset($_POST["Log_In_group_MEMBER_PASSWORD"]))?$_POST["Log_In_group_MEMBER_PASSWORD"]:"")  ."", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if ((isset($_POST["LogIn_submit"])&&(isset($_POST["Log_In_group_Log_me_in_automatically"])) && $_POST["Log_In_group_Log_me_in_automatically"] != "")) {
	setcookie("AutoLoginUN", "".((isset($_POST["Log_In_group_MEMBER_USERNAME"]))?$_POST["Log_In_group_MEMBER_USERNAME"]:"")  ."", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if($_SERVER["REQUEST_METHOD"] == "POST"){
	$WA_Auth_Parameter = array(
	"connection" => $elevate954,
	"database" => $database_elevate954,
	"tableName" => "MEMBERS",
	"columns" => explode($WA_Auth_Separator,"MEMBER_USERNAME".$WA_Auth_Separator."MEMBER_PASSWORD"),
	"columnValues" => explode($WA_Auth_Separator,"".((isset($_POST["Log_In_group_MEMBER_USERNAME"]))?$_POST["Log_In_group_MEMBER_USERNAME"]:"")  ."".$WA_Auth_Separator."".((isset($_POST["Log_In_group_MEMBER_PASSWORD"]))?$_POST["Log_In_group_MEMBER_PASSWORD"]:"")  .""),
	"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
	"sessionColumns" => explode($WA_Auth_Separator,"id".$WA_Auth_Separator."COMPANY_NAME".$WA_Auth_Separator."MEMBER_FIRST_NAME".$WA_Auth_Separator."MEMBER_LAST_NAME".$WA_Auth_Separator."ADDRESS".$WA_Auth_Separator."ADDRESS2".$WA_Auth_Separator."CITY".$WA_Auth_Separator."STATE".$WA_Auth_Separator."ZIP".$WA_Auth_Separator."PHONE_NUMBER".$WA_Auth_Separator."FAX_NUMBER".$WA_Auth_Separator."EMAIL".$WA_Auth_Separator."COMPANY_LOGO".$WA_Auth_Separator."COMPANY_SLOGAN"),
	"sessionNames" => explode($WA_Auth_Separator,"SecurityAssist_id".$WA_Auth_Separator."COMPANY_NAME".$WA_Auth_Separator."MEMBER_FIRST_NAME".$WA_Auth_Separator."MEMBER_LAST_NAME".$WA_Auth_Separator."ADDRESS".$WA_Auth_Separator."ADDRESS2".$WA_Auth_Separator."CITY".$WA_Auth_Separator."STATE".$WA_Auth_Separator."ZIP".$WA_Auth_Separator."PHONE_NUMBER".$WA_Auth_Separator."FAX_NUMBER".$WA_Auth_Separator."EMAIL".$WA_Auth_Separator."COMPANY_LOGO".$WA_Auth_Separator."COMPANY_SLOGAN"),
	"successRedirect" => "/members/dashboard.php?loggedIn=1",
	"failRedirect" => "login.php?failedLogin=1",
	"gotoPreviousURL" => TRUE,
	"keepQueryString" => TRUE
	);
	
	WA_AuthenticateUser($WA_Auth_Parameter);
}
?>
<?php
if((((isset($_SESSION["SecurityAssist_id"]) && $_SESSION["SecurityAssist_id"] != "")?"LoggedIn":"") == "")&&(((isset($_COOKIE["AutoLoginUN"]))?$_COOKIE["AutoLoginUN"]:"") != "")&&(((isset($_COOKIE["AutoLoginPWD"]))?$_COOKIE["AutoLoginPWD"]:"") != "")){
	$WA_Auth_Parameter = array(
	"connection" => $elevate954,
	"database" => $database_elevate954,
	"tableName" => "MEMBERS",
	"columns" => explode($WA_Auth_Separator,"MEMBER_USERNAME".$WA_Auth_Separator."MEMBER_PASSWORD"),
	"columnValues" => explode($WA_Auth_Separator,"".((isset($_COOKIE["AutoLoginUN"]))?$_COOKIE["AutoLoginUN"]:"")  ."".$WA_Auth_Separator."".((isset($_COOKIE["AutoLoginPWD"]))?$_COOKIE["AutoLoginPWD"]:"")  .""),
	"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
	"sessionColumns" => explode($WA_Auth_Separator,"id"),
	"sessionNames" => explode($WA_Auth_Separator,"SecurityAssist_id"),
	"successRedirect" => "",
	"failRedirect" => "",
	"gotoPreviousURL" => TRUE,
	"keepQueryString" => TRUE
	);
	
	WA_AuthenticateUser($WA_Auth_Parameter);
}
?>
<!DOCTYPE html>
<!-- 
Template Name: Conquer - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.0.3
Version: 1.5.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Purchase: http://themeforest.net/item/conquer-responsive-admin-dashboard-template/3716838?ref=keenthemes
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8"/>
<title>Conquer | Login</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta content="" name="description"/>
<meta content="" name="author"/>
<meta name="MobileOptimized" content="320">
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN PAGE LEVEL STYLES -->
<link rel="stylesheet" type="text/css" href="assets/plugins/select2/select2_conquer.css"/>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME STYLES -->
<link href="assets/css/style-conquer.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/style.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/plugins.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
<link href="assets/css/pages/login.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/custom.css" rel="stylesheet" type="text/css"/>
<!-- END THEME STYLES -->
<link rel="shortcut icon" href="favicon.ico"/>
</head>
<!-- BEGIN BODY -->
<body class="login">
<!-- BEGIN LOGO -->
<div class="logo">
	<img src="images/Black_Transparent.png" alt="" width="300"/>
</div>
<!-- END LOGO -->
<!-- BEGIN LOGIN -->
<div class="content">
	<!-- BEGIN LOGIN FORM --><?php 
@session_start();
if ("" == ""){
  // WA_ClearSession
	$clearAll = TRUE;
	$clearThese = explode(",","");
	if($clearAll){
		foreach ($_SESSION as $key => $value){
			unset($_SESSION[$key]);
		}
	}
	else{
		foreach($clearThese as $value){
			unset($_SESSION[$value]);
		}
	}
}
?>
<div id="LogOutContainer" class="WAATK">
  <h1>Log Out</h1>
  You have successfully logged out. <br>
  <a href="../index.php"><br>
RETURN TO WEB SITE</a> / <a href="login.php">BACK TO LOGIN </a></div>
  <div id="LogInContainer" class="WAATK">
    <div id="LogIn_Basic_Default_ProgressWrapper">
    <form class="Basic_Default" id="LogIn_Basic_Default" name="LogIn_Basic_Default" method="post" action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>">
    <fieldset class="Basic_Default" id="Log_In">
      <div class="lineGroup">        </div>
      <div class="lineGroup">        </div>
    </fieldset>
    </form>
  </div>
  <div id="LogIn_Basic_Default_ProgressMessageWrapper" class="blockUIOverlay" style="display:none;">
    <script type="text/javascript">
WADFP_SetProgressToForm('LogIn_Basic_Default', 'LogIn_Basic_Default_ProgressMessageWrapper', WADFP_Theme_Options['BigSpin:Slate']);
  </script>
    <div id="LogIn_Basic_Default_ProgressMessage" >
      <p style="margin:10px; padding:5px;" ><img src="webassist/progress_bar/images/slate-largespin.gif" alt="" title="" style="vertical-align:middle;" />&nbsp;&nbsp;Please wait</p>
    </div>
  </div>
</div>
<!-- END REGISTRATION FORM -->
</div>
<!-- END LOGIN -->
<!-- BEGIN COPYRIGHT -->
<div class="copyright">
2013 &copy;ELEVATE954. </div>
<!-- END COPYRIGHT -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<!--[if lt IE 9]>
<script src="assets/plugins/respond.min.js"></script>
<script src="assets/plugins/excanvas.min.js"></script> 
<![endif]-->
<script src="assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="assets/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script src="assets/plugins/jquery-validation/dist/jquery.validate.min.js" type="text/javascript"></script>
<script type="text/javascript" src="assets/plugins/select2/select2.min.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="assets/scripts/app.js" type="text/javascript"></script>
<script src="assets/scripts/login.js" type="text/javascript"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>
jQuery(document).ready(function() {     
  App.init();
  Login.init();
});
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>